package cn.homework.service.impl;

import cn.homework.dao.CommodityDao;
import cn.homework.dao.impl.CommodityDaoImpl;
import cn.homework.domain.Product;
import cn.homework.service.CommodityService;

import java.util.List;
import java.util.Map;

/**
 * @author ACT
 */
public class CommodityServiceImpl implements CommodityService {
    CommodityDao dao = new CommodityDaoImpl();

    @Override
    public void addCommodity(Product product) {
        dao.addCommodity(product);
    }

    @Override
    public List<Product> findAllCommodity() {
        return dao.findAllCommodity();
    }

    @Override
    public void delCommodityById(String id) {
        dao.delCommodityById(id);
    }

    @Override
    public Product findCommodityById(String id) {
        return dao.findCommodityById(id);
    }

    @Override
    public void updateCommodity(String id, Product product) {
        dao.updateCommodity(id, product);
    }

    @Override
    public List<Product> findCommodityCondition(Map<String, String[]> map) {
        return dao.findCommodityCondition(map);
    }
}
